home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / dev / src / ConfigFileSrc.lha / ConfigFileSrc12 / RexxLibrary / Funcs / Lock.c < prev    next >
Encoding:
Text File  |  1997-10-02  |  4.8 KB  |  173 lines

  1. /*
  2. **        $PROJECT: RexxConfigFile.library
  3. **        $FILE: Lock.c
  4. **        $DESCRIPTION: rxcf_Lock#?() functions
  5. **
  6. **        (C) Copyright 1997 Marcel Karas
  7. **             All Rights Reserved.
  8. */
  9.  
  10. IMPORT struct Library *CFBase;
  11.  
  12. /****** rexxconfigfile.library/cf_LockArgList ********************************
  13. *
  14. *   NAME
  15. *        cf_LockArgList -- Locks the argument list of a group node for use.
  16. *
  17. *   SYNOPSIS
  18. *        FirstArgNode = cf_LockArgList(GrpNode)
  19. *
  20. *        FIRSTARGNODE/N cf_LockArgList(GRPNODE/N/A)
  21. *
  22. *   FUNCTION
  23. *        This function locks the argument list of a group node for use, or
  24. *        NULL if the group node has no argument nodes. The pointer returned
  25. *        by this is NOT an actual ArgNode pointer - you should use one of the
  26. *        other ArgNode calls to get actual pointers to ArgNode structures
  27. *        (such as cf_NextArgument()), passing the value returned by
  28. *        cf_LockArgList() as the ArgNode value.
  29. *
  30. *   INPUTS
  31. *        GrpNode - The group node for the argument list.
  32. *
  33. *   RESULT
  34. *        FirstArgNode - First argument node of the group node or NULL.
  35. *                       NOT a valid node!
  36. *
  37. *   EXAMPLE
  38. *        ...
  39. *        myArgNode = cf_LockArgList(myGrpNode)
  40. *        If myArgNode ~= 0 Then Do
  41. *          Do While myArgNode ~= 0
  42. *            myArgNode = cf_NextArgument(myArgNode)
  43. *            ...
  44. *          End
  45. *          cf_UnlockArgList(myGrpNode)
  46. *        End
  47. *        ...
  48. *
  49. *   SEE ALSO
  50. *        cf_LockGrpList(), cf_LockItemList(), cf_UnlockArgList(),
  51. *        cf_NextArgument()
  52. *
  53. ******************************************************************************
  54. *
  55. */
  56.  
  57. UWORD rxcf_LockArgList ( RX_FUNC_ARGS, CFGroup * GrpNode )
  58. {
  59.     CFArgument    * FirstArgNode;
  60.  
  61.     if ( FirstArgNode = cf_LockArgList (GrpNode) )
  62.         *ResStr = CreateNumArgStrP (FirstArgNode);
  63.     return (RC_OK);
  64. }
  65.  
  66. /****** rexxconfigfile.library/cf_LockGrpList ********************************
  67. *
  68. *   NAME
  69. *        cf_LockGrpList -- Locks the group list of the header for use.
  70. *
  71. *   SYNOPSIS
  72. *        FirstGrpNode = cf_LockGrpList(Header)
  73. *
  74. *        FIRSTGRPNODE/N cf_LockGrpList(HEADER/N/A)
  75. *
  76. *   FUNCTION
  77. *        This function locks the group list of the header for use, or NULL
  78. *        if the header has no group nodes. The pointer returned by this is
  79. *        NOT an actual GrpNode pointer - you should use one of the other
  80. *        GrpNode calls to get actual pointers to GrpNode structures (such as
  81. *        cf_NextGroup()), passing the value returned by cf_LockGrpList()
  82. *        as the GrpNode value.
  83. *
  84. *   INPUTS
  85. *        Header - Pointer to the Header.
  86. *
  87. *   RESULT
  88. *        FirstGrpNode - First group node of the header or NULL.
  89. *                       NOT a valid node!
  90. *
  91. *   EXAMPLE
  92. *        ...
  93. *        myGrpNode = cf_LockGrpList(myHeader)
  94. *        If myGrpNode ~= 0 Then Do
  95. *          Do While myGrpNode ~= 0
  96. *            myGrpNode = cf_NextGroup(myGrpNode)
  97. *            ...
  98. *          End
  99. *          cf_UnlockGrpList(myHeader)
  100. *        End
  101. *        ...
  102. *
  103. *   SEE ALSO
  104. *        cf_LockArgList(), cf_LockItemList(), cf_UnlockGrpList(),
  105. *        cf_NextGroup()
  106. *
  107. ******************************************************************************
  108. *
  109. */
  110.  
  111. UWORD rxcf_LockGrpList ( RX_FUNC_ARGS, CFHeader * Header )
  112. {
  113.     CFGroup    * FirstGrpNode;
  114.  
  115.     if ( FirstGrpNode = cf_LockGrpList (Header) )
  116.         *ResStr = CreateNumArgStrP (FirstGrpNode);
  117.     return (RC_OK);
  118. }
  119.  
  120. /****** rexxconfigfile.library/cf_LockItemList *******************************
  121. *
  122. *   NAME
  123. *        cf_LockItemList -- Locks the item list of an argument node for use.
  124. *
  125. *   SYNOPSIS
  126. *        FirstItemNode = cf_LockItemList(ArgNode)
  127. *
  128. *        FIRSTITEMNODE/N cf_LockItemList(ARGNODE/N/A)
  129. *
  130. *   FUNCTION
  131. *        This function locks the item list of an argument node for use, or
  132. *        NULL if the argument node has no item nodes. The pointer returned by
  133. *        this is NOT an actual ItemNode pointer - you should use one of the
  134. *        other ItemNode calls to get actual pointers to ItemNode structures
  135. *        (such as cf_NextItem()), passing the value returned by
  136. *        cf_LockItemList() as the ItemNode value.
  137. *
  138. *   INPUTS
  139. *        ArgNode - The argument node for item list.
  140. *
  141. *   RESULT
  142. *        FirstItemNode - First item node of the argument node or NULL.
  143. *                        NOT a valid node!
  144. *
  145. *   EXAMPLE
  146. *        ...
  147. *        myItemNode = cf_LockItemList(myArgNode)
  148. *        If myItemNode ~= 0 Then Do
  149. *          Do While myItemNode ~= 0
  150. *            myItemNode = cf_NextItem(myItemNode)
  151. *            ...
  152. *          End
  153. *          cf_UnlockItemList(myArgNode)
  154. *        End
  155. *        ...
  156. *
  157. *   SEE ALSO
  158. *        cf_LockArgList(), cf_LockGrpList(), cf_UnlockItemList(),
  159. *        cf_NextItem()
  160. *
  161. ******************************************************************************
  162. *
  163. */
  164.  
  165. UWORD rxcf_LockItemList ( RX_FUNC_ARGS, CFArgument * ArgNode )
  166. {
  167.     CFItem    * FirstItemNode;
  168.  
  169.     if ( FirstItemNode = cf_LockItemList (ArgNode) )
  170.         *ResStr = CreateNumArgStrP (FirstItemNode);
  171.     return (RC_OK);
  172. }
  173.